// Lindsay Gilmour
// Adam Lusch
// Dan Niceswanger
//
// Computer Graphics Project 2:
// Teapot racing!

#ifndef TIMER_H
#define TIMER_H

#include <GL/glut.h>

#include <sys/time.h>
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
using namespace std;

class Timer
{
	public:
		
		Timer(GLfloat, GLfloat, bool);
		~Timer();
		
		void setOrthographicProjection();
		void resetPerspectiveProjection();
		
		void displayTime();
		
		void startTimer();
		
		string getText(double = 0.0);
		double getSeconds();
		
		void saveTimes(double);
		
		double getTotal();
		vector <double> getLaps();
		
	private:
		
		bool isLap;
		
		GLfloat scrPosX, scrPosY;
		
		string sTime;
		
		double totalTime;
		vector <double> lapTimes;
		
		timeval start, end;
};


#endif
